package com.sc.nft.mapper;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.sc.nft.entity.DaoEcologyPointsWallet;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.sc.nft.entity.vo.AdminDaoEcologyPointsVO;
import com.sc.nft.entity.vo.AdminDaoEcologyPointsWalletVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.math.BigDecimal;

/**
 * <p>
 * Dao生态积分钱包 Mapper 接口
 * </p>
 *
 * @author liGen
 * @since 2024-11-26
 */
@Mapper
public interface DaoEcologyPointsWalletMapper extends BaseMapper<DaoEcologyPointsWallet> {


    Page<AdminDaoEcologyPointsWalletVO> getPage(Page page, @Param("daoName") String daoName);

    /**
     * 加积分
     * @param id
     * @param sum
     * @param oldAmount
     * @return
     */
    Boolean addAmount(@Param("id") Long id, @Param("sum") BigDecimal sum, @Param("oldAmount") BigDecimal oldAmount);

    /**
     * 减积分
     * @param id
     * @param sum
     * @param oldAmount
     * @return
     */
    Boolean subAmount(@Param("id") Long id, @Param("sum") BigDecimal sum, @Param("oldAmount") BigDecimal oldAmount);

}
